package com.xuecheng.filesystem.controller;/**
 * @author ：yuan_he_song
 * @date ：Created in 2019/5/15 21:44
 * @description：${description}
 */

import com.xuecheng.api.filesystem.FileSystemControllerApi;
import com.xuecheng.filesystem.service.FileSystemService;
import com.xuecheng.framework.domain.filesystem.response.UploadFileResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName:
 * @author  ：yuan_he_song
 * @date  ： 2019/5/15 21:44
 */
@RestController
@RequestMapping("systemfile")
public class FileSystemController implements FileSystemControllerApi {

    @Autowired
    private FileSystemService fileSystemService;

    @Override
    @PostMapping("upload")
    public UploadFileResult uploadFile(@Param("file")MultipartFile file, String businesskey, String filetag, String metadata) {

        return fileSystemService.uploadFile(file,businesskey,filetag,metadata);
    }
}
